<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML>
<html class="">
<head>
	
	<meta name="author" content="蓝凌科技">
	<meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />

	<link rel="stylesheet" type="text/css" href="/Public/Api/css/sm.min.css">	
	<link rel="stylesheet" type="text/css" href="/Public/Api/css/sm-extend.min.css">	
	
	<title>帮工小哥</title>
	
	<script type="text/javascript">
	    var _root = '<?php echo ($_site_url); echo U(' / ');?>', _controller = '<?php echo ($_controller); ?>';
	</script>
	
	
	<link rel="stylesheet" type="text/css" href="/Public/Api/css/order.css">


</head>
<body>
	
	

<div class="page-group">
    <div class="page page-current pay-details">
        <div class="order-foot bar bar-standard bar-footer">
            <div class="content-block order-foot-block">
                <div class="row">
                    <div class="col-100">
                    	<form action="" method="post" id="dataform">
	                    	<a href="#" onclick="addAddress()" class="button button-big button-fill button-pay">添加地址</a>
	                    	<input type="hidden" name="type" id="type" value="<?php echo ($type); ?>"/>
	                    	<input type="hidden" name="data" id="data" value='<?php echo ($data); ?>'/>
	                    	<input type="hidden" name="address_id" id="address_id" value=""/>
                    	</form>
                    </div>
                </div>
            </div>
        </div>
        <div class="content address">
            <div class="list-block media-list">
            	<?php if(!empty($list)): if(is_array($list)): foreach($list as $key=>$address): ?><ul class="address-details">
		                    <li>
		                        <label class="label-checkbox item-content">
		                        	<?php if($type == '2'): ?><input type="radio" name="address_id" id="address_id" value="<?php echo ($address['address_id']); ?>"><?php endif; ?>
		                            <div class="item-media">
		                            	<?php if($type == '2'): ?><i class="icon icon-form-checkbox"></i><?php endif; ?>
		                            </div>
		                            <div class="item-inner">
		                                <div class="item-title-row">
		                                    <ul>
		                                        <li><span>客户姓名：</span><span><?php echo ($address['contact']); ?></span></li>
		                                        <li><span>联系电话：</span><span><?php echo ($address['telphone']); ?></span></li>
		                                        <li>
		                                            <span>维修地址：</span><span class="address-span"><?php echo ($address['address']); ?></span>
		                                        </li>
		                                    </ul>
		                                </div>
		                            </div>
		                        </label>
		                    </li>
		                    <div class="icon-write" address-id="<?php echo ($address['address_id']); ?>"></div>
		                </ul><?php endforeach; endif; endif; ?>
            </div>
        </div>
    </div>
</div>




	<!-- 底部
================================================== -->
<footer>
</footer>
<script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/api.php?s=", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    
</script>
<script src="/Public/Api/js/zepto.min.js" type="text/javascript">
</script>
<script type="text/javascript">
//坑死人的配置项
//若不加此配置，则所有页面均使用 js 和 css 缓存
$.config = {
   	router: false
}
</script>
<script src="/Public/Api/js/sm.min.js" type="text/javascript">
</script>
<script src="/Public/Api/js/sm-extend.min.js" type="text/javascript">
</script>
<script src="/Public/Api/js/think.js" type="text/javascript">
</script>


<script type="text/javascript">

$("input[type='radio']").on('change', function(){
	$("#address_id").val($(this).val());
	var target = Think.U('UserAddress/order');
	$("#dataform").attr('action', target);
	$(document).find('form').submit();
});

$(".icon-write").on('click', function(){
	$("#address_id").val($(this).attr('address-id'));
	var target = Think.U('UserAddress/editAction');
	$("#dataform").attr('action', target);
	$(document).find('form').submit();
});

function addAddress(){
	$("#address_id").val('');
	var target = Think.U('UserAddress/editAction');
	$("#dataform").attr('action', target);
	$(document).find('form').submit();
}
</script>

<!-- 用于加载js代码 -->

</body>
</html>